﻿<!DOCTYPE html>
<html>
<head>
    <!--数据服务管理-->
    <meta charset="utf-8">
    <title>系统概况</title>
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!-- #CSS Links -->
    <!-- Basic Styles -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/font-awesome.css">

    <!-- SmartAdmin Styles : Caution! DO NOT change the order -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-production-plugins.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-production.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-skins.css">

    <!-- SmartAdmin RTL Support -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-rtl.css">

    <!-- Demo purpose only: goes with demo.js, you can delete this css when designing your own WebApp -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/demo.css">

    <!-- #FAVICONS -->
    <link rel="shortcut icon" href="img/favicon/favicon.ico" type="image/x-icon">
    <link rel="icon" href="img/favicon/favicon.ico" type="image/x-icon">

    <!-- #GOOGLE FONT -->
    <link rel="stylesheet" href="css/open-sans.css" type="text/css">

    <!-- #APP SCREEN / ICONS -->
    <link rel="apple-touch-icon" href="img/splash/sptouch-icon-iphone.png">
    <link rel="apple-touch-icon" sizes="76x76" href="img/splash/touch-icon-ipad.png">
    <link rel="apple-touch-icon" sizes="120x120" href="img/splash/touch-icon-iphone-retina.png">
    <link rel="apple-touch-icon" sizes="152x152" href="img/splash/touch-icon-ipad-retina.png">

    <!-- iOS web-app metas : hides Safari UI Components and Changes Status Bar Appearance -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- Startup image for web apps -->
    <link rel="apple-touch-startup-image" href="img/splash/ipad-landscape.png"
        media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)">
    <link rel="apple-touch-startup-image" href="img/splash/ipad-portrait.png"
        media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)">
    <link rel="apple-touch-startup-image" href="img/splash/iphone.png" media="screen and (max-device-width: 320px)">
    <link href="js/plugin/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />

    <link href="appcss/Common.css" rel="stylesheet" />

</head>
<body class="desktop-detected minified">
    <!-- #MAIN PANEL -->
    <div id="main" role="main">

        <!-- RIBBON -->
        <div id="ribbon">

            <span class="ribbon-button-alignment">
                <span class="btn btn-ribbon"><i class="fa fa-home"></i></span>
            </span>

            <!-- breadcrumb -->
            <ol class="breadcrumb">
                <li>系统概况</li>
            </ol>
            <!-- end breadcrumb -->

        </div>
        <!-- END RIBBON -->


        <!-- MAIN CONTENT -->
        <div id="content">
            <div class="row hidden">
                <div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
                    <h2 class="page-title txt-color-blueDark">
                        <i class="fa fa-table fa-fw "></i>
                        主页
                        <span>系统概况
                        </span>
                    </h2>
                </div>
            </div>
            <!-- widget grid -->
            <section id="widget-grid" class="">

                <!-- row -->
                <div class="row" style="margin-top: 8px;">
                    <article class="col-xs-12 col-sm-12 ">
                        <!-- Widget ID (each widget will need unique ID)-->
                        <div class="jarviswidget jarviswidget-sortable"
                            data-widget-editbutton="false">
                            <header>
                                <span class="widget-icon"><i class="fa fa-table"></i></span>
                                <h2>数据服务概况</h2>
                            </header>

                            <!-- widget div-->
                            <div>
                                <!-- widget content -->
                                <div class="widget-body">
                                    <div class="table-responsive">
                                        <table class="table table-bordered  table-hover smart-form"
                                            id="table-dataservice">
                                            <thead>
                                                <tr>
                                                    <th>类型</th>
                                                    <th>数量</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td colspan="2">信息加载中</td>
                                                </tr>
                                            </tbody>
                                        </table>

                                    </div>

                                </div>
                                <!-- end widget content -->

                            </div>
                            <!-- end widget div -->
                        </div>
                        <!-- end widget -->
                        <!-- Widget ID (each widget will need unique ID)-->
                        <div class="jarviswidget jarviswidget-sortable" id="wid-id-1"
                            data-widget-editbutton="false">
                            <header>
                                <span class="widget-icon"><i class="fa fa-table"></i></span>
                                <h2>数据表概况</h2>
                            </header>

                            <!-- widget div-->
                            <div>

                                <div class="jarviswidget-editbox">
                                    总数：
                                    <span style="margin-right: 15px!important; color: #191970;"><a id="tableTotalCount" href="DataTableManagement.html"></a></span>
                                    <br />
                                    <br />
                                    可追踪数据表数：
                                    <span id="tableRawTableCount" style="margin-right: 15px!important; color: #191970;"></span>
                                    不可追踪数据表数：
                                    <span id="tableNoneRawTableCount" style="margin-right: 15px!important; color: #191970;"></span>
                                    <br />
                                    <br />

                                </div>
                                <!-- end widget edit box -->
                                <!-- widget content -->
                                <div class="widget-body">
                                    <div class="table-responsive">
                                        <table class="table table-bordered table-hover smart-form" id="table-datatable">
                                            <thead>
                                                <tr>
                                                    <th>名称</th>
                                                    <th>数据源数量</th>
                                                    <th>是否可追踪</th>
                                                    <th>创建时间</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td colspan="4">信息加载中</td>
                                                </tr>
                                            </tbody>
                                        </table>

                                    </div>

                                </div>
                                <!-- end widget content -->

                            </div>
                            <!-- end widget div -->

                        </div>
                        <!-- end widget -->
                        <div class="jarviswidget jarviswidget-sortable" id="Div1"
                            data-widget-editbutton="false">
                            <header>
                                <span class="widget-icon"><i class="fa fa-table"></i></span>
                                <h2>任务概况</h2>
                            </header>
                            <!-- widget div-->
                            <div>

                                <!-- widget edit box -->
                                <div class="jarviswidget-editbox">
                                    总任务：
                                    <span style="margin-right: 15px!important; color: #191970;"><a id="taskTotal" href="SchedulingTaskManagement.html"></a></span>
                                    <br />
                                    <br />
                                    定时模式：
                                    <span id="taskTimer" style="margin-right: 15px!important; color: #191970;"></span>
                                    闹钟模式：
                                    <span id="taskAlarm" style="margin-right: 15px!important; color: #191970;"></span>
                                    手动模式：
                                    <span id="taskManual" style="margin-right: 15px!important; color: #191970;"></span>
                                    事件模式：
                                    <span id="taskEvent" style="margin-right: 15px!important; color: #191970;"></span>
                                    <br />
                                    <br />
                                </div>
                                <!-- end widget edit box -->
                                <!-- widget content -->
                                <div class="widget-body">
                                    <div class="table-responsive">
                                        <table class="table table-bordered  table-hover smart-form" id="table-task">
                                            <thead>
                                                <tr>
                                                    <th>任务名称</th>
                                                    <th>执行时间</th>
                                                    <th>数据总量</th>
                                                    <th>入库数量</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td colspan="4">信息加载中</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <!-- end widget content -->

                            </div>
                            <!-- end widget div -->

                        </div>
                        <div class="jarviswidget jarviswidget-sortable" id="Div2"
                            data-widget-editbutton="false">
                            <header>
                                <span class="widget-icon"><i class="fa fa-table"></i></span>
                                <h2>外部数据抽取概况</h2>
                            </header>
                            <!-- widget div-->
                            <div>
                                <!-- widget edit box -->
                                <div class="jarviswidget-editbox">
                                    <!-- This area used as dropdown edit box -->

                                </div>
                                <!-- end widget edit box -->
                                <!-- widget content -->
                                <div class="widget-body">
                                    <div class="table-responsive">
                                        <table class="table table-bordered  table-hover smart-form" id="table-app">
                                            <thead>
                                                <tr>
                                                    <th>外部程序名称</th>
                                                    <th>执行时间</th>
                                                    <th>数据总量</th>
                                                    <th>退回</th>
                                                    <th>入库数量</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td colspan="5">信息加载中</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <!-- end widget content -->

                            </div>
                            <!-- end widget div -->

                        </div>
                        <!-- end widget -->
                        <div class="jarviswidget jarviswidget-sortable" data-widget-editbutton="true">
                            <header>
                                <span class="widget-icon"><i class="fa fa-table"></i></span>
                                <h2>系统日志</h2>
                            </header>
                            <!-- widget div-->
                            <div>
                                <!-- widget edit box -->
                                <div class="jarviswidget-editbox">
                                    <!-- This area used as dropdown edit box -->

                                </div>
                                <!-- end widget edit box -->
                                <!-- widget content -->
                                <div class="widget-body">
                                    <ul class="demo-btns">
                                        <li>
                                            <a class="btn  btn-default btn-xs" href="LogIndex.html">查看 </a>
                                        </li>
                                    </ul>
                                    <div class="table-responsive">
                                        <table class="table table-bordered  table-hover smart-form" id="table-systemlog">
                                            <thead>
                                                <tr>
                                                    <th>类型</th>
                                                    <th>时间</th>
                                                    <th>内容</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td colspan="3">信息加载中</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <!-- end widget content -->

                            </div>
                            <!-- end widget div -->

                        </div>
                        <!-- end widget -->
                    </article>
                    <!-- WIDGET END -->

                </div>

                <!-- end row -->

            </section>
            <!-- end widget grid -->
        </div>
        <!-- END MAIN CONTENT -->
    </div>

    <!-- END #MAIN CONTENT -->

    <!--================================================== -->

    <!-- PACE LOADER - turn this on if you want ajax loading to show (caution: uses lots of memory on iDevices)
<script data-pace-options='{ "restartOnRequestAfter": true }' src="js/plugin/pace/pace.min.js"></script>-->


    <!-- #PLUGINS -->
    <!-- Link to Google CDN's jQuery + jQueryUI; fall back to local -->


    <script src="js/libs/jquery-2.1.1.min.js"></script>
    <script src="js/libs/jquery-ui-1.10.3.min.js"></script>
    <!-- BOOTSTRAP JS -->
    <script src="js/bootstrap/bootstrap.min.js"></script>

    <!-- IMPORTANT: APP CONFIG -->
    <script src="js/app.config.js"></script>


    <!-- CUSTOM NOTIFICATION -->
    <script src="js/notification/SmartNotification.min.js"></script>

    <!-- JARVIS WIDGETS -->
    <script src="js/smartwidgets/jarvis.widget.min.js"></script>


    <!-- SPARKLINES -->
    <script src="js/plugin/sparkline/jquery.sparkline.min.js"></script>

    <!-- JQUERY MASKED INPUT -->
    <script src="js/plugin/masked-input/jquery.maskedinput.min.js"></script>


    <!-- JQUERY UI + Bootstrap Slider -->
    <script src="js/plugin/bootstrap-slider/bootstrap-slider.min.js"></script>


    <!-- <script src="js/plugin/datatables/jquery.dataTables.min.js"></script>-->
    <script src="js/plugin/datatables/jquery.dataTables.min.js"></script>
    <script src="js/plugin/datatables/dataTables.colVis.min.js"></script>
    <script src="js/plugin/datatables/dataTables.tableTools.min.js"></script>
    <script src="js/plugin/datatables/dataTables.bootstrap.min.js"></script>
    <script src="js/plugin/datatable-responsive/datatables.responsive.min.js"></script>

    <script src="js/app.min.js"></script>
    <script src="appjs/Helper.js"></script>
    <script src="appjs/Common.js"></script>
    <script>
        $(function () {
            //数据服务
            $.ajax({
                url: apiUrl,
                data: {
                    "sys:sno": "Summary",
                    "sys:act": "GetDataServiceList"
                },
                dataType: "json",
                success: function (data) {
                    if (data.IsSccuess) {
                        var trs = "";
                        for (var i = 0; i < data.Data.Items.length; i++) {
                            trs += "<tr>";
                            trs += ("<td><a href='DataServiceManagement.html'>" + data.Data.Items[i].TypeText + "</a></td>");
                            trs += ("<td>" + data.Data.Items[i].Count + "</td>");
                            trs += "</tr>";
                        }
                        $("#table-dataservice tbody").html(trs);
                    } else {
                        if (IsLogined(data.ErrorCode)) {
                            alert(data.Message);
                        }
                    }
                },
                beforeSend: function () {
                    // $("btn_login").html("登录中...");
                }
            });
            //数据表
            $.ajax({
                url: apiUrl,
                data: {
                    "sys:sno": "Summary",
                    "sys:act": "GetDataTableList"
                },
                dataType: "json",
                success: function (data) {
                    if (data.IsSccuess) {
                        $("#tableNoneRawTableCount").html(data.Data.NoneRawTableCount);
                        $("#tableRawTableCount").html(data.Data.RawTableCount);
                        $("#tableTotalCount").html(data.Data.TotalCount);
                        var trs = "";
                        for (var i = 0; i < data.Data.Tables.length; i++) {
                            trs += "<tr class='rowdatatr' data='" + data.Data.Tables[i].Id + "'>";
                            trs += ("<td><a href='DataTableDetails.html?tableId=" + data.Data.Tables[i].Id + "'>" + data.Data.Tables[i].Name + "</a></td>");
                            trs += ("<td>" + data.Data.Tables[i].Sources.length + "</td>");
                            trs += ("<td>" + data.Data.Tables[i].IsRawDt + "</td>");
                            trs += ("<td>" + data.Data.Tables[i].CreatedTime + "</td>");
                            trs += "</tr>";
                            if (data.Data.Tables[i].Sources.length > 0) {
                                for (var j = 0; j < data.Data.Tables[i].Sources.length; j++) {
                                    trs += "<tr class='sourcedata " + data.Data.Tables[i].Id + "' style='display:none; background-color: #ecf3f8;'>";
                                    trs += ("<td colspan='4' style='padding-left:40px;'>" + data.Data.Tables[i].Sources[j].DataSourceName + "</td>");
                                    trs += "</tr>";
                                }
                            }
                        }
                        $("#table-datatable tbody").html(trs);
                        $(".rowdatatr").click(function() {
                            var $this = $(this);
                            $(".rowdatatr").css("background-color", "");
                            $this.css("background-color", "rgb(236, 243, 248)");
                            $(".sourcedata").hide();
                            $("." + $this.attr("data")).show();
                        });
                    } else {
                        if (IsLogined(data.ErrorCode)) {
                            alert(data.Message);
                        }
                    }
                },
                beforeSend: function () {
                    // $("btn_login").html("登录中...");
                }
            });
            //任务
            $.ajax({
                url: apiUrl,
                data: {
                    "sys:sno": "Summary",
                    "sys:act": "GetTaskList"
                },
                dataType: "json",
                success: function (data) {
                    if (data.IsSccuess) {
                        $("#taskTotal").html(data.Data.Total);
                        $("#taskManual").html(data.Data.Manual);
                        $("#taskTimer").html(data.Data.Timer);
                        $("#taskAlarm").html(data.Data.Alarm);
                        $("#taskEvent").html(data.Data.Event);
                        var trs = "";
                        for (var i = 0; i < data.Data.Tasks.length; i++) {
                            trs += "<tr>";
                            trs += ("<td><a href='SchedulingTaskExecutionRecord.html?taskId=" + data.Data.Tasks[i].Id + "'>" + data.Data.Tasks[i].Name + "</a></td>");
                            trs += ("<td>" + data.Data.Tasks[i].ExecutedTime + "</td>");
                            trs += ("<td>" + data.Data.Tasks[i].DataCount + "</td>");
                            trs += ("<td>" + data.Data.Tasks[i].InsertSuccessCount + "</td>");
                            trs += "</tr>";
                        }
                        $("#table-task tbody").html(trs);
                    } else {
                        if (IsLogined(data.ErrorCode)) {
                            alert(data.Message);
                        }
                    }
                },
                beforeSend: function () {
                    // $("btn_login").html("登录中...");
                }
            });
            //外部数据
            $.ajax({
                url: apiUrl,
                data: {
                    "sys:sno": "Summary",
                    "sys:act": "GetExtractionList"
                },
                dataType: "json",
                success: function (data) {
                    if (data.IsSccuess) {
                        var trs = "";
                        for (var i = 0; i < data.Data.Items.length; i++) {
                            trs += "<tr>";
                            trs += ("<td>" + data.Data.Items[i].AppName + "</td>");
                            trs += ("<td>" + data.Data.Items[i].CreatedTime + "</td>");
                            trs += ("<td>" + data.Data.Items[i].DataCount + "</td>");
                            trs += ("<td>" + data.Data.Items[i].ExtractedCount + "</td>");
                            trs += ("<td>" + data.Data.Items[i].RejectedCount + "</td>");
                            trs += "</tr>";
                        }
                        $("#table-app tbody").html(trs);
                    } else {
                        if (IsLogined(data.ErrorCode)) {
                            alert(data.Message);
                        }
                    }
                },
                beforeSend: function () {
                    // $("btn_login").html("登录中...");
                }
            });
            //日志
            $.ajax({
                url: apiUrl,
                data: {
                    "sys:sno": "Summary",
                    "sys:act": "GetLogList"
                },
                dataType: "json",
                success: function (data) {
                    if (data.IsSccuess) {
                        var trs = "";
                        for (var i = 0; i < data.Data.Items.length; i++) {
                            trs += "<tr>";
                            trs += ("<td>" + data.Data.Items[i].Tag + "</td>");
                            trs += ("<td>" + data.Data.Items[i].CreatedTime + "</td>");
                            trs += ("<td>" + data.Data.Items[i].Message + "</td>");
                            trs += "</tr>";
                        }
                        $("#table-systemlog tbody").html(trs);
                    } else {
                        if (IsLogined(data.ErrorCode)) {
                            alert(data.Message);
                        }
                    }
                },
                beforeSend: function () {
                    // $("btn_login").html("登录中...");
                }
            });
        });
    </script>

</body>
</html>
